{% extends 'cms/base.html' %}

{% block title %}
    发布新闻
{% endblock %}

{% block head %}
    <script src="{% static 'js/write_news.js' %}"></script>
{% endblock %}

{% block content-header %}
    <h1>发布新闻</h1>
{% endblock %}

{% block content %}
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <!--
                <div class="box-header with-border">
                    <h3 class="box-title">Quick Example</h3>
                </div>
                -->
                <!-- /.box-header -->
                <!-- form start -->
                <form role="form" method="post">
                    <div class="box-body">
                        <div class="form-group">
                            <label for="title-form">标题</label>
                            <input type="text" name="title" class="form-control" id="title-form"
                                   placeholder="请输入新闻标题..">
                        </div>
                        <div class="form-group">
                            <label for="desc-form">描述</label>
                            <input type="text" name="desc" class="form-control" id="desc-form" placeholder="请输入新闻描述..">
                        </div>
                        <div class="form-group">
                            <label for="category-form">分类</label>
                            <!-- <input type="text" name="category" class="form-control" id="category-form" placeholder="请选择新闻分类"> -->
                            <select name="category" id="category-form" class="form-control">
                                {% for category in categories %}
                                    <option value="{{ category.id }}">{{ category.name }}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="thumbnail-form">缩略图</label>
                            <div class="input-group">
                                <input type="text" name="thumbnail" class="form-control" id="thumbnail-form"
                                       placeholder="请选择新闻分类">
                                <span class="input-group-btn">
                                    <label class="btn btn-primary btn-file">上传图片<input hidden type="file" id="upload-file" class="btn btn-primary">
                                    </label>
                                </span>
                            </div>
{#                            style="display: none"#}
                            <!--
                            <div class="input-group">
                                <div class="input-group-addon">$</div>
                                <input type="text" class="form-control" id="exampleInputAmount" placeholder="Amount">
                                <div class="input-group-addon">.00</div>
                            </div>
                            -->
                        </div>
                        <div class="form-group">
                            <label for="content-form">内容</label>
                            <!-- <textarea name="thumbnail" class="form-control" id="thumbnail-form" placeholder="请选择新闻分类"> -->
                            <textarea name="content" id="content-form" cols="30" rows="10"
                                      class="form-control"></textarea>
                        </div>

                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <button type="submit" class="btn btn-primary pull-right">发布</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
{% endblock %}